import {
  defineConfig
} from 'vite'
import vue from '@vitejs/plugin-vue'
import postcssPxToViewport from 'postcss-px-to-viewport'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  css: {
    postcss: {
      plugins: [
        // viewport 布局适配
        postcssPxToViewport({
          // 基准大小 
          viewportWidth: 750
        })
      ]
    }
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'), // 路径别名
      'api': path.resolve(__dirname, './src/api'),
    }
  }
})